package org.tbjd.client.mediators;

import org.tbjd.client.exceptions.TBJDException;
import org.tbjd.client.interfaces.HasMediator;
import org.tbjd.client.interfaces.Observer;

public class ProjectSwitcherMediator extends AbstractMediator implements Observer, HasMediator {

	private AbstractMediator mediator = null;

	public AbstractMediator getMediator() {
		return mediator;
	}

	public void setMediator(AbstractMediator mediator) {
		this.mediator = mediator;
		this.mediator.addObserver(this);
	}

	public void decide(Object action) {
		System.out.println("ProjectSwitcherMediator.decide()");
		try {
			mediator.decide(action);
		} catch (TBJDException e) {
			e.printStackTrace();
		}
	}

	public void delegate(Object action) {
	}

	public void handle(Object action) {
	}

	public void update(Object sender) {
		System.out.println("ProjectSwitcherMediator.update()");
		notifyObservers(sender);
	}

}
